#!/bin/bash
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

export DEVICE_ID=0
export SLOG_PRINT_TO_STDOUT=0

train_code_path=/home/wan/Projects/naic2020/naic2020_seg_mindspore
eval_path=/home/wan/Projects/naic2020/naic2020_seg_mindspore/cache/ms
data_root=/home/wan/data/seg_naic/final_test/
data_list=/home/wan/data/seg_naic/final_test/test_list.txt
ckpt_path=/home/wan/Projects/naic2020/naic2020_seg_mindspore/checkpoints/model.ckpt

if [ -d ${eval_path} ]; then
  rm -rf ${eval_path}
fi
mkdir -p ${eval_path}

python ${train_code_path}/eval.py \
  --data_root=${data_root}  \
  --data_lst=${data_list}  \
  --batch_size=16  \
  --ignore_label=255  \
  --num_classes=17  \
  --scales=0.5  \
  --scales=0.75  \
  --scales=1.0  \
  --scales=1.25  \
  --scales=1.75  \
  --ckpt_path=${ckpt_path} \
  --device GPU \
  2>&1 | tee ${eval_path}/eval_log
